@mkdir fyi
@set logfile=fyi\allvalidate.txt
@ Date /T >>%logfile%
@ TIME /T >>%logfile%
@db2 "SELECT  ' rebind package '|| RTRIM(r.routineschema)|| '.P'|| SUBSTR(CHAR(r.lib_id+10000000),2)|| ' @  -- '|| RTRIM(r.ROUTINENAME) FROM SYSCAT.routines r WHERE r.routineName = 'S_PBC_CUST_BY_ID' AND ((r.origin = 'Q' ) OR EXISTS ( SELECT 1 FROM syscat.packages WHERE pkgschema = r.routineschema AND pkgname = 'P'||SUBSTR(CHAR(r.lib_id+10000000),2)  ))"   >> %logfile%
@start %logfile%
